/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "colorpantrap")
@NamedQueries({
    @NamedQuery(name = "Colorpantrap.findAll", query = "SELECT c FROM Colorpantrap c"),
    @NamedQuery(name = "Colorpantrap.findByIdcolorpantrap", query = "SELECT c FROM Colorpantrap c WHERE c.idcolorpantrap = :idcolorpantrap"),
    @NamedQuery(name = "Colorpantrap.findByColorpantrap", query = "SELECT c FROM Colorpantrap c WHERE c.colorpantrap = :colorpantrap")})
public class Colorpantrap implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idcolorpantrap")
    private Integer idcolorpantrap;
    @Column(name = "colorpantrap")
    private String colorpantrap;
    @OneToMany(mappedBy = "colorpantrap", fetch = FetchType.LAZY)
    private List<Monitoring> monitoringList;

    public Colorpantrap() {
    }

    public Colorpantrap(Integer idcolorpantrap) {
        this.idcolorpantrap = idcolorpantrap;
    }

    public Integer getIdcolorpantrap() {
        return idcolorpantrap;
    }

    public void setIdcolorpantrap(Integer idcolorpantrap) {
        this.idcolorpantrap = idcolorpantrap;
    }

    public String getColorpantrap() {
        return colorpantrap;
    }

    public void setColorpantrap(String colorpantrap) {
        this.colorpantrap = colorpantrap;
    }

    public List<Monitoring> getMonitoringList() {
        return monitoringList;
    }

    public void setMonitoringList(List<Monitoring> monitoringList) {
        this.monitoringList = monitoringList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idcolorpantrap != null ? idcolorpantrap.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Colorpantrap)) {
            return false;
        }
        Colorpantrap other = (Colorpantrap) object;
        if ((this.idcolorpantrap == null && other.idcolorpantrap != null) || (this.idcolorpantrap != null && !this.idcolorpantrap.equals(other.idcolorpantrap))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Colorpantrap[idcolorpantrap=" + idcolorpantrap + "]";
    }

}
